home *** CD-ROM | disk | FTP | other *** search
- Presenting MoreCLI 1.2 by El Pedro - A selection of CLI tools.
-
- This production comprises some extra CLI commands which should be copied into
- your C: directory, and 'rearc', a shell script to demonstrate some of the
- trickier ones. The script is useful for recompressing archives.
- You require Workbench 2.04 or higher to use these programs. (I do not
- normally support 1.3)
- Some of these commands were written a while ago. They were written so that I
- could automate the repacking of archives, which isn't really possible with
- the standard CLI commands.
- The commands which print output to stdout are really meant for shell
- substitution with the "'". See the example script for details.
-
- Here comes a description of the commands:
-
-
- AddPart - Template: DIR/A,FILE/A
-
- This prints the full pathname produced by joining the directory name and
- the filename given, taking notice of ':' and '/':
-
- 1> AddPart DH0:Prefs Sound
- DH0:Prefs/Sound
- 1> AddPart DH0:Prefs/ Sound
- DH0:Prefs/Sound
- 1> AddPart DH0: Prefs.info
- DH0:Prefs.info
-
-
- df - Template: DEVICE,COUNT/S
-
- A friend challenged me to write a program like C:Info, but instead gave
- information in (Mega/Kilo)bytes used instead of blocks. I also added a
- feature to do a byte count. This is the resulting program. You require
- Kickstart 2.0 or above to use this program.
-
- df - List all which matches mask in dfMask variable.
- df #? - List all devices.
- df dh?: - List all hard drive partitions.
- df dh?: count - List all hard drive partitions, and do a byte count.
- df ~(xh?:) - List all partitions, except XPK'd ones (XPK partitions
- cause space to be counted twice, three times, four...)
-
- DF uses the template DEVICE,COUNT/S. DEVICE is a pattern for the devices
- to list, and COUNT is a flag to say whether to do a bytecount.
- If you do not give a device to list, it will use the pattern in the dfMask
- variable - if that variable is not set, then it will use "#?" (all devices)
-
- 6.System3.0:> setenv dfMask ([DEF]H|SQ)#?
- 6.System3.0:> df
- Unit Size Full Used Free Status Name
- DH0: 10.1M 83.7% 8.47M 1.64M Read System3.0
- DH1: 30.0M 67.5% 20.3M 9.75M Read Utils
- DH2: 10.1M 73.4% 7.43M 2.68M Read/Write Work
- DH3: 20.0M 94.0% 18.8M 1.20M Read XPK
- DH4: 25.7M 78.1% 20.0M 5.61M Read Incoming
- DH5: 22.8M 64.0% 14.6M 8.20M Read/Write Temp
- Total 118M 75.5% 89.8M 29.1M 10.8M
- ^- This value is the amount of
- WRITEABLE disk space. May be useful for a BBS with a
- CD mounted, and you want to know how much space for
- user files there is.
-
- If you run DF without IPrefs running, it screws up. This appears to be
- a 'feature' of RawDoFmt(). I could fix this, but it would increase the size
- of DF somewhat.
-
- ExtPart Template: FILE/A
-
- This prints the extension part of a filename given. If there is no extension,
- then the name itself is returned:
-
- 1> ExtPart Disk.info
- .info
- 1> ExtPart Disk
- Disk
- 1> ExtPart Archive1.00.lha
- .lha
-
-
- FilePart - Template: FILE/A
-
- This prints the file part of a full pathname.
-
- 1> FilePart DH0:Prefs/
-
- 1> FilePart DH0:Prefs/Sound
- Sound
- 1> FilePart DH0:Prefs.info
- Prefs.info
-
-
- FullPath - Template: FILE/A
-
- This expands the filename given into its full pathname. Unlike the other
- commands, the file/directory given has to exist. This could be useful for
- preserving the case of a filename given to your script.
-
- 1> FullPath LOCALE:
- System:Locale
- 1> FullPath ""
- Work:DICE/MoreCLI
- 1> FullPath c:dir
- System:C/Dir
-
-
- Inhibit - DRIVE/A,ON/S,OFF/S
-
- C:Lock stops writing to a drive. Inhibit stops reading from a drive. When
- you inhibit a drive, it will just appear as DF0:BUSY on Workbench. Very handy
- when DMSing lots of files, you know, when you rip a disk out after DMSing it,
- and you get the 'You must replace...' requester. After inhibiting the drive,
- you will not get the requester.
-
- 1> Inhibit DF0: on
- Enables read protection of DF0:
- 1> Inhibit DF0: off
- Disables read protection of DF0:
- 1> Inhibit DF0: on off
- Equivalent to Diskchange, but sometimes works better (alias it?)
-
- Usually Inhibiting nests (it depends what filesystem you use. FFS nests.)
- So if you inhibit a drive twice, you have to uninhibit it twice. You can
- also unlock a drive which another program has locked.
-
-
- PathPart - Template: FILE/A
-
- This prints the file part of a full pathname.
-
- 1> PathPart DH0:Prefs
- DH0:
- 1> PathPart DH0:Prefs/Sound
- DH0:Prefs
- 1> PathPart DH0:Prefs.info
- DH0:
-
-
- StemPart - Template: FILE/A
-
- This prints the stem part of a filename given. If there is no extension,
- then the name itself is returned:
-
- 1> StemPart Disk.info
- Disk
- 1> StemPart Disk
- Disk
- 1> StemPart Archive1.00.lha
- Archive1.00
-